<template>
  <div class="mod-config">
		<el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
			<el-tab-pane label="条码打印" name="first">
				<print-barcode ref="first"></print-barcode>
			</el-tab-pane>
			<el-tab-pane label="品种打印" name="second">
				<print-brand ref="second"></print-brand>
			</el-tab-pane>
			<el-tab-pane label="价签打印" name="three">
				<print-tag ref="three"></print-tag>
			</el-tab-pane>
			<el-tab-pane label="商品标价签打印" name="four">
				<goods-tag ref="four"></goods-tag>
			</el-tab-pane>
		</el-tabs>
  </div>
</template>
<script>
  import PrintBarcode from './PrintBarcode'
  import PrintBrand from './PrintBrand'
  import PrintTag from './PrintTag'
  import GoodsTag from './PrintGoodsTag'
  export default {
    data() {
      return {
        activeName: 'first'
      };
    },
    components: {
      PrintBarcode,
      PrintBrand,
      PrintTag,
      GoodsTag
    },
    created(){
      this.$nextTick(() => {
        // this.$refs['first'].searchHandle()
      })
      web_DSPrtEngineStartup1()
    },
    methods: {
      handleClick(tab, event) {
        this.$nextTick(() => {
          // this.$refs[tab.name].clearSearchForm()
          if(tab['name'] == 'first' || tab['name'] == 'four'){
            // this.$refs[tab.name].searchHandle()
          }
        })
      }
    }
  };
</script>
